<%@ Page Language="C#" MasterPageFile="~/PgMaster.master" AutoEventWireup="true" CodeFile="testcase_regression.aspx.cs" Inherits="testcase_regression"  Title="Exceed - Aviva Automation Framework" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script src="js/JScripts.js" type="text/javascript" language="javascript"></script>
<script language="JavaScript1.2" type="text/javascript">
        isIE=document.all;
        isNN=!document.all&&document.getElementById;
        isN4=document.layers;
        isHot=false;

        function dd(e)
        {
            if (!ddEnabled) return;
            whichDog=isIE ? document.all.theLayer : document.getElementById("theLayer");  
            whichDog.style.left=isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx; 
            whichDog.style.top=isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety;
            return false;  
        }

        function ddN4(whatDog)
        {
            if (!isN4) return;
            N4=eval(whatDog);
            N4.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
            N4.onmousedown=function(e)
            {
                N4.captureEvents(Event.MOUSEMOVE);
                N4x=e.x;
                N4y=e.y;
            }
            N4.onmousemove=function(e)
            {
                if (isHot)
                {
                    N4.moveBy(e.x-N4x,e.y-N4y);
                    return false;
                }
            }
            N4.onmouseup=function()
            {
            N4.releaseEvents(Event.MOUSEMOVE);
            }
        }

        function hideMe()
        {
            if (isIE||isNN)
            {
                whichDog=isIE ? document.all.theLayer : document.getElementById("theLayer"); 
                whichDog.style.visibility="hidden";
                document.getElementById('fade').style.display = 'none';
                document.getElementById('<%=rbtnNew.ClientID%>').checked = false;
                document.getElementById('<%=rbtnOld.ClientID%>').checked = false;
            }  
            else if (isN4) 
            {
            document.theLayer.visibility="hide";
            document.getElementById('fade').style.display='none';
            }
        }

        function showMe(e){
            whichDog=isIE ? document.all.theLayer : document.getElementById("theLayer"); 
            if (isIE||isNN) whichDog.style.visibility="visible";
            else if (isN4) document.theLayer.visibility="show";
            document.getElementById('theLayer').style.display='block';
            document.getElementById('fade').style.display='block'
            if (e == 'Save') {
                document.getElementById('bxtxt').style.display = 'block';
                document.getElementById('radiobtn').style.display = 'none';
                document.getElementById('UpdateFinal').style.display = 'none';                
            }
            else if (e == 'Edit') {
//                document.getElementById('bxtxt').style.display = 'none';
                document.getElementById('savebtns').style.display = 'none';
                document.getElementById('<%=lblPopHeader.ClientID%>').innerHTML = 'Save As...';
                document.getElementById('radiobtn').style.display = 'block';
                document.getElementById('UpdateFinal').style.display = 'block';
                document.getElementById('<%=rbtnOld.ClientID%>').checked = true;  
            }
            scroll(0,0);
            document.getElementById("<%=txtBtchName.ClientID%>").focus();          
        }
        document.onmouseup = Function("ddEnabled=false");
</script>
<script type="text/javascript" language="javascript">
function radioClick(e) {
    if (e == 'new') {
        document.getElementById('bxtxt').style.display = 'none';
        document.getElementById('savebtns').style.display = 'none';
        document.getElementById('<%=lblPopHeader.ClientID%>').innerHTML = 'Save As...';
        document.getElementById('radiobtn').style.display = 'block';
        document.getElementById('UpdateFinal').style.display = 'block';
    }
    else if (e == 'old') {
        document.getElementById('bxtxt').style.display = 'block';
        document.getElementById('savebtns').style.display = 'block';
        document.getElementById('<%=lblPopHeader.ClientID%>').innerHTML = 'Please provide a batch name';
        document.getElementById('radiobtn').style.display = 'block';
        document.getElementById('UpdateFinal').style.display = 'none';
    }
}
</script>
<table align="center" border="0" cellpadding="0" cellspacing="0" style="height: 107%" valign="top" width="100%">
        <tr>
            <td style="padding-right: 2em; padding-left: 2em; vertical-align: top; height: 527px"
                width="98%">
                    <table style="width: 854px; height: 14px">
                        <tr>
                            <td style="width: 672px"><h2>Test Case Selection - <asp:Label ID="lblFlowType" runat="server" Font-Bold="True" Font-Size="Medium" ForeColor="#C00000"></asp:Label></h2></td>
                            <td style="text-align: right">
                                <asp:LinkButton ID="btnRefresh" runat="server" CssClass="ColorLink" OnClick="btnRefresh_Click" Style="cursor: hand" ToolTip="Refresh">Refresh</asp:LinkButton> |
                                <asp:LinkButton ID="btnReset" runat="server" CssClass="ColorLink" OnClick="btnReset_Click" ToolTip="Reset All" OnClientClick="if (!confirm('This action will delete all Test Cases/Transactions added currently. Are you sure to do this?')) return false" Style="cursor: hand">Reset</asp:LinkButton> |
                                <a href="#" onclick="javascript: DisplayHelp();" class="ColorLink" title="Framework Help">Help</a>
                          </td>
                        </tr>
                    </table>
                <font class="HeaderText">
            <br />
                <font face="Verdana" size="2">Number of Testcases you want to Execute: </font>
                <asp:TextBox ID="txtTestCases" runat="server" MaxLength="3" Style="width: 50px; height: 19px">1</asp:TextBox>&nbsp;
                <asp:Button ID="Go" runat="server" class="btnOK" name="Go" OnClick="doAddRow" OnClientClick="if (!confirm('This action will delete all existing rows(if any) and create fresh rows. Are you sure to do this?')) return false;"
                    Style="width: 67px; cursor: hand" Text="Go" />&nbsp;
                &nbsp;&nbsp;<br />
                <br />
                <asp:Panel ID="pnlTestCaseRow" runat="server" Visible="false">
                    <font class="HeaderText">
                    <table style="width:100%;">
                        <tr>
                            <td style="width: 548px">
                                <font class="HeaderText">
                                <asp:Label ID="lblBatchName" runat="server" Text=""></asp:Label>
                                </font>
                            </td>
                            <td>
<%--                                <font class="HeaderText" style="text-align: right">
                                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </font>--%>
                            </td>
                        </tr>
                    </table>
                    </font></asp:Panel>
                    <br />
                <br />
                <asp:Label ID="lblEdittingFor" runat="server" Font-Bold="true" Font-Size="Medium"
                    ForeColor="Red" Text=""></asp:Label>
                <asp:Label ID="lblTransactionDetails" runat="server" Text=""></asp:Label><br />
                    &nbsp; 
                    <asp:Button ID="btnRunBatch" runat="server" class="Runbtn" Enabled="false" onclick="btnRunBatch_Click" Style="cursor: hand" Text="Run Batch" ToolTip="Click to Run loaded batch." />
                    &nbsp;
                    <asp:Button ID="btnSave" runat="server" class="Savebtn" Enabled="False" OnClientClick="showMe('Save');return false;" Style="cursor: hand" Text="Save" ToolTip="Click to save batch." />
                    &nbsp;
                    <asp:Button ID="btnUpdate" runat="server" class="btnUpdate" OnClientClick="showMe('Edit');return false;" Style="cursor: hand" Text="Update" ToolTip="Click to update batch." Visible="False" />
                    <br /><br />
                    &nbsp;
                <asp:LinkButton ID="btnExistingBatch" runat="server" Enabled="true" Font-Names="Times New Roman"
                    ForeColor="MidnightBlue" OnClick="btnExistingBatch_Click" Style="cursor: hand"
                    Text="My Existing Batches" ToolTip="Click to view existing batches."></asp:LinkButton>
                    <%--<asp:Button runat ="server" ID="btnExistingBatch" Text ="Existing Batches" OnClick ="btnExistingBatch_Click" Enabled="true"/>--%>
                <asp:HiddenField ID="hdnUpdateInd" runat="server" Value="" />
                <asp:HiddenField ID="hdnBatchName" runat="server" Value="" />
                <asp:HiddenField ID="hdnDelID" runat="server" />
                <div id="theLayer" class="white_content" style="font-size: 12pt; left: 450px; visibility: hidden;width: 250px; font-family: Times New Roman; position: absolute; top: 310px">
                    <table bgcolor="#424242" border="0" cellpadding="5" cellspacing="0" width="260">
                        <tbody>
                            <tr>
                                <td style="width: 100%; height: 114px; text-align: center">
                                    <table border="0" cellpadding="0" cellspacing="0" height="10" width="100%">
                                        <tbody>
                                            <tr>
                                                <td id="titleBar" style="width: 97%; cursor: move; height: 5px; text-align: left;">
                                                    <ilayer onselectstart="return false" width="100%"></ilayer>
                                                    <layer onmouseout="isHot=false" onmouseover="isHot=true;if (isN4) ddN4(theLayer)" width="100%"></layer>
                                                    <font color="#ffffff" face="Arial"><label id="lblPopHeader" runat="server">Please provide a Batch Name</label></font>
                                                </td>

                                                <td style="width: 28px; cursor: hand; height: 5px" valign="top">
                                                    <a href="#" onclick="hideMe();return false;" class="RemoveUnderline"><font color="#ffffff" face="arial" size="2">X</font></a>
                                                </td>
                                            </tr>
                                            <tr>
                                               <td bgcolor="#00000e" colspan="2" style="padding-right: 4px; padding-left: 4px; padding-bottom: 2px; padding-top: 4px; background-color: whitesmoke; text-align: center;" width="100%">
                                                   <p id="bxtxt" style="text-align: center;">
                                                        <asp:TextBox ID="txtBtchName" runat="server" Height="20px" MaxLength="20" Width="191px"></asp:TextBox>
                                                        <p id="savebtns"><asp:Button ID="btnchngName" runat="server" class="btnOK" OnClick="btnchngName_Click" OnClientClick="if(EmptyCheck()==false){return false;};" Style="cursor: hand" Text="OK" ValidationGroup="one" Width="61px" />
                                                        <asp:Button ID="btnDSave" runat="server" class="btncncl" OnClick="btnDefualtSave_Click" OnClientClick="if (!confirm('Clicking on Cancel will save batch with system generated name. Are you sure to do this?')) return false;" Style="cursor: hand" Text="Cancel" /></p>
                                                   </p>
                                                   <p id="radiobtn" style="text-align: center;">
                                                        <asp:RadioButton ID="rbtnOld" runat="server" Text="Update existing Batch"  GroupName="saveas" onClick="radioClick('new');"/>&nbsp;&nbsp;  
                                                        <asp:RadioButton ID="rbtnNew" runat="server" Text="New Batch" GroupName="saveas"  onClick="radioClick('old');" />                                                       
                                                   </p>
                                                   <p id="UpdateFinal" style="text-align: center;">
                                                        <asp:Button ID="btnUpdateFinal" runat="server" class="btnOK" OnClick="btnUpdateFinal_Click" OnClientClick="" Style="cursor: hand" Text="Update" />
                                                   </p>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
              <div id="fade" class="black_overlay" style="left: 0%; top: 0%; color: #000000;"><layer onmouseout="isHot=false" onmouseover="isHot=true;if (isN4) ddN4(theLayer)" width="100%"></div>
               <asp:HiddenField ID="hdnTest" runat="server" Value="" />
                <asp:HiddenField ID="hdnChangeStatus" runat="server" />
                <asp:Label ID="lblTransaction" runat="server"></asp:Label>
                <asp:Panel ID="pnlScenarios" runat="server" Visible="false">
                    <br />
                    <asp:Button ID="btnAdd" runat="server" class="btnaddtran" OnClick="btnAdd_Click"
                        Style="cursor: hand" Text="Add Transactions" />
                    &nbsp;
                    <asp:Button ID="btnCancel" runat="server" class="btncncl" OnClick="btnCancel_Click"
                        Style="cursor: hand" Text="Cancel" /><br />
                    </asp:Panel>
                    <asp:Panel ID="pnlTcTransactionDetails" runat="server" Visible="false">
                    <br />
                    &nbsp;
                    <asp:Label ID="lblTcTransactionDetails" runat="server" Text=""></asp:Label></asp:Panel>
                    <asp:Panel ID="pnlExistingBatch" runat="server" Visible="false">
                    <br />
                    <asp:Label ID="lblExistingBatch" runat="server" Font-Bold="true" Text="Saved Batches : "></asp:Label></asp:Panel>
                    <span style="color: #000000">
                        <br />
                    </span>
                    <asp:LinkButton ID="lbDeleteSlctd" runat="server" class="lnkdelbtn" Font-Names="Times New Roman"
                    ForeColor="MidnightBlue" OnClick="lbDeleteSlctd_Click" OnClientClick="return deleteallcheck('<%#hdnDelID.ClientID%>');"
                    Style="cursor: hand" Visible="False">Delete Selected Batches</asp:LinkButton><br />
        </tr>
    </table>
</asp:Content>